package org.ctsi.rsds.client;

import javax.ws.rs.core.Response;

import org.ctsi.rsds.api.IResourceObjModel;
import org.ctsi.rsds.base.rest.result.ObjectRESTResult;
import org.ctsi.rsds.base.util.JsonUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("resourceApi")
public class ResourceApi {
	
	@Autowired
	private IResourceObjModel resourceObjModel;
	
	private ObjectRESTResult result;
	
	public void getResourceObjById(){
		Response response = resourceObjModel.findResObjByResObjId("01b1350e123d48dab63e125af37b2cbb");
		if(response.getStatus() == 200){
			result = (ObjectRESTResult) response.getEntity();
		}
		try {
			System.out.println(JsonUtils.toJson(result));
		} catch (Exception e) {
			e.printStackTrace();
		} 
	}

}
